//
//  GrowDataManager.h
//  leo
//
//  Created by 常艳 on 15/12/10.
//  Copyright (c) 2015年 mdx. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DBHelper.h"
#import "Task.h"
#import "Tooler.h"
#import "ExpPolicy.h"
#import "Growth.h"
#import "Theme.h"
#import "ThemeLock.h"
#import "ThemeLevel.h"
#import "User.h"
#define GrowDataManager_TAG @"GrowDataManager-----------------------"
@interface GrowDataManager : NSObject
@property (nonatomic,strong) DBHelper *theHelper;
-(NSArray *)getSysTasks;
-(Task *)getSysTask:(NSString *)id;
-(Growth *)getLatestGrowth:(NSString *)deviceUid;
-(Growth *)getTodayGrowth:(NSString *)deviceUid;

-(BOOL)addsysTasks:(NSArray *)tasks;
-(NSArray *)getTasks:(NSString *)ownerId targetUid:(NSString *)targetUid;
-(BOOL)updateSysTaskPic:(NSString *)pic_url taskId:(NSString *)taskId;
-(BOOL)updateSysTaskAudio:(NSString *)audio_url taskId:(NSString *)taskId;
-(BOOL)updateHistoryTaskPic:(NSString *)pic_url taskId:(NSString *)taskId;
-(BOOL)updateHistoryTaskAudio:(NSString *)audio_url randomCode:(NSString *)randomCode targetUid:(NSString *)targetUid audioHash:(NSString *)audioHash;
-(BOOL)setTask:(Task *)task;
-(BOOL)finishTask:(Task *)task;
-(BOOL)confirmTask:(Task *)task;
-(NSString *)getMaxTaskTime:(NSString *)ownerId deviceUid:(NSString *)deviceUid;
-(BOOL)addHistoryTasks:(NSArray *)taskArray;
-(BOOL)addPolicies:(NSArray *)policyArray;
-(BOOL)addGrowth:(Growth *)growth deviceUid:(NSString *)deviceUid;
-(BOOL)updatePushTaskPic:(NSString *)pic_url randomCode:(NSString *)randomCode;
-(BOOL)updatePushTaskAudio:(NSString *)audio_url randomCode:(NSString *)randomCode targetUid:(NSString *)targetUid audioHash:(NSString *)audioHash;



-(NSArray *)getThemes;
-(BOOL)setTheme:(NSString *)deviceUid themeId:(NSString *)themeId;
-(NSArray *)getThemeLocks:(NSString *)themeId;
-(Theme *)getThemeInfo:(NSString *)themeId;
-(ThemeLevel *)getLevelInfo:(NSString *)themeId level:(int)level;
-(NSString *)getTaskAudioHash:(NSString *)randomCode targetUid:(NSString *)targetUid;
-(BOOL)setWatchTheme:(NSString *)deviceUid themeId:(int)themeId themeLevel:(int)themeLevel;
@end
